import request from '@/sheep/request';
import Request from 'luch-request';

const ReportApi = {
  getHairApi: (data) => {
    return request({
      url: '/userinfo/get_hair_data',
      method: 'POST',
      data: data,
    });
  },
  addHairApi: (data) => {
    return request({
      url: '/userinfo/add_hair_data',
      method: 'POST',
      data: data,
    });
  },
  getStyleApi: (data) => {
    // return request({
    //   url: '/userinfo/get_user_face_info',
    //   method: 'POST',
    //   data: data,
    // });

    return Promise.resolve({ data: {} });
  },
  praiseTextApi: (data) => {
    return request({
      url: '/ai/praiseTexttwo',
      method: 'POST',
      data: data,
    });
  },
  wardrobeListApi: (data) => {
    return request({
      url: '/wardrobe/clothes_list',
      method: 'POST',
      data: data,
    });
  },
  exchangeHairApi: (data) => {
    return request({
      url: '/api/v1/test/exchangeHair',
      method: 'POST',
      data: data,
    });
  },
  exchangeHairHistoryByTaskId: (data) => {
    return request({
      url: '/api/v1/test/exchangeHairHistoryByTaskId',
      method: 'POST',
      data: data,
    });

    // return Promise.resolve()
  },
  hairStyleListApi: (data) => {
    return request({
      url: '/api/v1/test/getHairDetails',
      method: 'POST',
      data: data,
    });
  },

  /**获取AI返回的人脸信息 */
  getAiFaceResult: () =>
    request({
      url: '/cloth/getFaceList',
      method: 'POST',
      data: {
        // dataScope   0查询自己上传的，1查询所有
        dataScope: 0,
      },
    }),

  getUserInfo: () =>
    request({
      url: '/digital/records/get-by-user-id',
      method: 'get',
    }),

  getUserAvatar: () =>
    request({
      url: '/member/user/get',
      method: 'get',
    }),

  sendMail: (data) => {
    const http = new Request({
      // baseURL: 'https://fitting-room.huimeimeta.com/api/pdf',
      baseURL: 'https://nestjs.huimeimeta.com/api/sendMail',
      timeout: 100 * 1000,
      method: 'POST',
      // #ifdef H5
      // 跨域请求时是否携带凭证（cookies）仅H5支持（HBuilderX 2.6.15+）
      withCredentials: false,
      // #endif
    });

    // const http = init();

    return http.request({
      method: 'POST',
      data,
    });
  },

  getImage: () =>
    request({
      url: '/digital/triple-image/page ',
      method: 'get',
    }),

  getToken: () =>
    request({
      url: '/member/auth/login',
      method: 'post',
      data: {
        mobile: '18399996666',
        password: '123456',
      },
    }),

  // https://puton.huimeimeta.com/app-api/cloth/getFaceList
};
export default ReportApi;
